package com.skh.util;

import cn.hutool.core.io.FileUtil;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 获取指定包下的所有类,用来统计写了几道算法题了.
 */
public class FileTest {
    public static void main(String[] args) {
        String originFile = "/Users/cindy/Desktop/code/oj-practice/src/main/java/com/skh/";
        File file = FileUtil.file(originFile);
        String[] list = file.list();
        List<String> fileList = new ArrayList<>();
        for (String dir : list) {
            File file1 = FileUtil.file(originFile+dir);
            String[] list1 = file1.list();
            Collections.addAll(fileList, list1);
        }
        Collections.sort(fileList);

        fileList.forEach(System.out::println);
        System.out.println("size = " + fileList.size());
    }

}
